#!/usr/bin/env python
#-*- coding: utf-8 -*-

from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

from spider.app import create_app, db
from spider.scripts import commands

manager = Manager(create_app)

if __name__ == '__main__':
    migrate = Migrate(manager.app(), db)
    manager.add_command('db', MigrateCommand)
    for c in commands:
        manager.add_command(c, commands.get(c)())
    manager.run()
